Online-Academy
Look, Read, Understand, Apply

Operating System

FAQ - III

  1. What is Device Management?

    Answer: Device management is the function of an operating system responsible for managing hardware I/O devices such as:

    • Keyboard
    • Mouse
    • Printer
    • Disk
    • Network Devices
    • Display
    The OS uses device drivers and I/O-management techniques to control these devices. Major functions of Device management are:
    • Device allocation
    • Device scheduling
    • Device-driver management
    • Buffering
    • Error handling
    • I/O coordination

  2. Explain Polling in an I/O System.

    Answer: Polling is an I/O technique in which the CPU repeatedly checks a device to determine whether it requires service. The CPU continues checking until the device becomes ready. Polling can waste CPU time because the CPU repeatedly checks the device even when no I/O event has occurred.

  3. Compare Interrupt-Drive I/O with Polling.

    Answer:

    PollingInterrupt-Driven I/O
    CPU repeatedly checks device statusDevice sends an interrupt when service is needed
    CPU may waste time checkingCPU can perform other work
    Simple to implementMore complex
    Suitable in some simple systemsGenerally more efficient for asynchronous events

  4. Define Direct Memory Access (DMA).

    Answer: Direct Memory Access (DMA) is a technique that allows an I/O device to transfer data directly to or from main memory without requiring the CPU to handle every individual byte or word.

    CPU --> DMA Controller --> Device, Main Memory
    The CPU typically initializes the DMA transfer, and the DMA controller performs the data transfer. After completion, the controller can interrupt the CPU. DMA significantly reduces CPU overhead during large data transfers.
  5. How Does Multithreading Perform Better Than Single Threading?

    Answer: Multithreading can improve performance because multiple threads can execute different parts of a program concurrently. Advantages include:

    • Responsiveness: One thread can continue while another waits.
    • Resource sharing: Threads share the same process resources.
    • Economy: Creating threads is generally cheaper than creating processes.
    • Parallelism: On multicore processors, multiple threads can execute simultaneously.
    • Better CPU utilization: CPU time can be used while another thread waits for I/O.
    Example:

    Single Thread: CPU --> Computation --> I/O wait -- > Computation

    Multiple Threads:

  6. Thread 1 --> Computation --> I/O wait
  7. Thread 2 --> Computation --> Computation
  8. Thread 3 --> I/O --> Computation
  9. Thus, multithreading can improve responsiveness and CPU utilization.

  10. Compare Authentication with Authorization.

    Answer:

    AuthenticationAuthorization
    Verifies who the user isDetermines what the user is allowed to do
    Happens before authorizationUsually occurs after authentication
    Example: username/passwordExample: permission to delete a product
    Answers: Who are you?Answers: What can you do?

    Authentication mechanisms
    • Username and password
    • PIN
    • OTP
    • Biometrics
    • Security tokens
    • Multi-factor authentication
    • Digital certificates
    Authorization mechanisms
    • Role-Based Access Control (RBAC)
    • Attribute-Based Access Control (ABAC)
    • Access Control Lists (ACL)
    • Capability-based access control
    • Permission-based access control